package utils.common;

import java.io.UnsupportedEncodingException;

/**
 * Created by Administrator on 2016/6/20.
 * url 参数加解密
 */
public class UrlUtil {

    /**加密*/
    public String encode(String param){
        try {
            return java.net.URLEncoder.encode(param,"utf-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return param;
    }

    /**解密*/
    public String decode(String param){
        try {
            return java.net.URLDecoder.decode(param,"utf-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return param;
    }

}
